import requests, json

class SteamToken(object):
    def __init__(self, host):
        self.url = host + '/steam-oauth/oauth/oauth/token'
        self.client_id = "steam"
        self.client_secret = "secret"
        self.grant_type = "password"
        self.username = "admin"
        self.password = "NGpaQCUyM2VIJTVFQ0cybnNKQkE="

    def get_token(self):
        data = {"client_id": self.client_id, "client_secret": self.client_secret, "grant_type": self.grant_type,
                "username": self.username,
                "password": self.password}
        r = requests.post(self.url, data)
        result = r.json()
        print(result)
        return result["access_token"]
